#include("/template/common/layout/_page_layout.html")
#@layout()

#define css()
<style>
    .layui-form-label{
        width: 150px;
    }

</style>
#end

#define js()
<script type="text/javascript">
    layui.use(['form', 'layer'], function () {
        // 操作对象
        var form = layui.form
            , layer = layui.layer
            , $ = layui.jquery;

        form.on('submit(sub)', function(data){

            util.sendAjax ({
                type: 'POST',
                url: '#(ctxPath)/app/OrgStructure/postAddStructure',
                data: $('#addForm').serialize(),
                loadFlag: true,
                success : function(data){
                    pop_close();
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>
#end

#define content()
<div class="x-body">
    <form id="addForm" class="layui-form" action="">
        <input type="hidden" name="orgstructure.parentID" placeholder="" class="layui-input layui-disabled" value="#(parentID)" required  lay-verify="required" autocomplete="off" readonly="readonly"/>
        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>架构名称:</label>
            <div class="layui-input-inline">
                <input type="text" name="orgstructure.name" placeholder="" class="layui-input" value="" required  lay-verify="required" autocomplete="off"   style="min-width: 500px"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>组织类型:</label>
            <div class="layui-input-inline"  style="min-width: 500px">
                <!--<input type="text" name="orgstructure.orgType" placeholder="" class="layui-input" value="" required  lay-verify="required" autocomplete="off"/>-->
                <select name="orgstructure.orgType" readonly="readonly" >
                    <option value="0" #(orgType =='0'?'selected':'disabled')>管理机构</option>
                    <option value="1" #(orgType =='1'?'selected':'disabled')>企业机构</option>
                    <option value="2" #(orgType =='2'?'selected':'disabled')>服务机构</option>
                    <option value="3" #(orgType =='3'?'selected':'disabled')>审查团体</option>
                    <option value="4" #(orgType =='4'?'selected':'disabled')>专业团体</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>组织编号:</label>
            <div class="layui-input-inline">
                <input type="text" name="orgstructure.orgID" placeholder="" class="layui-input layui-disabled" value="#(org.id)" required  lay-verify="required" autocomplete="off" readonly="readonly"  style="min-width: 500px"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>上级架构:</label>
            <div class="layui-input-inline">
                <input type="text" name="struct" placeholder="" class="layui-input layui-disabled" value="#(parentStructName)" required  lay-verify="required" autocomplete="off" readonly="readonly"  style="min-width: 500px" />
            </div>
        </div>

        <div class="layui-form-item" style="margin: 0 35%; min-width: 120px">
            <label class="layui-form-label"></label>
            <ton  class="layui-btn" lay-filter="sub" lay-submit>保存</ton>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </form>
</div>

#end